import Vue from 'vue'
import VueRouter from 'vue-router'
import Regist from '../views/Regist.vue'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import SpuDetails from '../views/SpuDetails.vue'
import Cart from '../views/Cart.vue'
import Account from '../views/Account.vue'
import Address from '../views/Address.vue'
import OrderList from '../views/OrderList.vue'
import SpuList from '../views/SpuList.vue'
Vue.use(VueRouter)

const routes = [{
  path: '/regist',
  name: 'regist',
  component: Regist
}, {
  path: '/login',
  name: 'login',
  component: Login
}, {
  path: '/',
  name: 'home',
  component: Home
}, {
  path: '/spuDetails',
  name: 'spuDetails',
  component: SpuDetails
}, {
  path: '/cart',
  name: 'cart',
  component: Cart
}, {
  path: '/account',
  name: 'account',
  component: Account
}, {
  path: '/address',
  name: 'address',
  component: Address
}, {
  path: '/orderlist',
  name: 'orderlist',
  component: OrderList
}, {
  path: '/spulist',
  name: 'spulist',
  component: SpuList
}]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
